import os
from html import escape

with open('/home/satone/HOL4inWeb/static/sitemap.txt', 'r') as f:
    n = 0
    m = 0
    with open('/home/satone/HOL4inWeb/static/sitemap/sitemap.xml','a') as fs:
        for url in f.readlines():
            fs.write('''
<url>
 <loc>{}</loc>
 <priority>0.5</priority>
 <lastmod>2020-07-06T09:27:48+08:00</lastmod>
 <changefreq>weekly</changefreq>
</url>
            '''.format(escape(url)))

#2020年7月5日 10:29:57
#curl -H 'Content-Type:text/plain' --data-binary @urls1.txt "http://data.zz.baidu.com/urls?site=www.holreference.top&token=OYzankyGSBqbZqBB"

import urllib

urllib.parse.quote